UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ORHFOd3g6Scin02N+ovlt1a8r7ZbRVSJG0rHcVjoEYc=' 
WHERE 
  key_id = 'eb5462fa5ebafbff23125cd03405874a9ce39d8c7c084ccef472b57636ab186f' 
  AND (
    token = 'ORHFOd3g6Scin02N+ovlt1a8r7ZbRVSJG0rHcVjoEYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046