UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlikaTufA/A2uxGa8UOwBxdaFMyly9cfdSs6mSkP1d0=' 
WHERE 
  key_id = 'a2d1c0b117c955c0965e8a5ae97454070cb02ae2d0ea40144442253602baca9f' 
  AND (
    token = 'YlikaTufA/A2uxGa8UOwBxdaFMyly9cfdSs6mSkP1d0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047