UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AIl6TV4G39CC9SE5mkvlUH4c0OA6NHhiRCb3rCAegDo=' 
WHERE 
  key_id = '45d6e93c488093427f7dc245a339c2d562db55804035dbb1dba07e253ec797cf' 
  AND (
    token = 'AIl6TV4G39CC9SE5mkvlUH4c0OA6NHhiRCb3rCAegDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046