UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Ithb/hyT+Jnf7DxQ4DhpHeHjDUSf8lth3rh2/zzhjE=' 
WHERE 
  key_id = '13a58b900d54405ad832f05fcefd36c84d5a39215d977d08ede3a3550ddacfe4' 
  AND (
    token = '4Ithb/hyT+Jnf7DxQ4DhpHeHjDUSf8lth3rh2/zzhjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043