UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r1ysgcjXkYG8ov5mk6CB4336hD9YqWn7iHvdrZAs+/0=' 
WHERE 
  key_id = 'd06ce3f56ca08b6760d4d64ef5ec1cf300f9482ddccd8c0c2e72bf1bb68db8c3' 
  AND (
    token = 'r1ysgcjXkYG8ov5mk6CB4336hD9YqWn7iHvdrZAs+/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026