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

Query time 0.00026