UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CMVcW7HwwK7SEJDY9jyMMM8AA4dvGFSUtnS00G2ecnE=' 
WHERE 
  key_id = 'f22f77cef50684a27701398db9c4dbd663da6355aa0e194c5d6a2dc3d76d76fa' 
  AND (
    token = 'CMVcW7HwwK7SEJDY9jyMMM8AA4dvGFSUtnS00G2ecnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018