UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0CgXF3rZKrX3mv0Z7KxD9Uzc3uaUgaO/pgDWrEQ/ocQ=' 
WHERE 
  key_id = '7302d3f29c40462db9dd1dc2be92c1807a29095f6061839b907c3ee855a765fb' 
  AND (
    token = '0CgXF3rZKrX3mv0Z7KxD9Uzc3uaUgaO/pgDWrEQ/ocQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017