UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kNIlmB5b0oQrP2LjQHpg/pRIE1xXMy+SFgT0L9ZfhlM=' 
WHERE 
  key_id = 'c33eed4c4bf0477d8e2413689da966edf98a1daa9887859b7f15e38865be55f3' 
  AND (
    token = 'kNIlmB5b0oQrP2LjQHpg/pRIE1xXMy+SFgT0L9ZfhlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049