UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fx9ucVC7zMEjWQSZm3EA7I44NohoheJLng3Zf0ksdp8=' 
WHERE 
  key_id = '8bfcd9138577c0f3c43d444fdf8813015fba568e9460091cd879caf61f0be178' 
  AND (
    token = 'Fx9ucVC7zMEjWQSZm3EA7I44NohoheJLng3Zf0ksdp8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047