UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GDHY8maC8X6cFuSbHw29syWghsNF5omFTCdL+srMwnA=' 
WHERE 
  key_id = '63bfd7069ab65f19e404187b231b9b127b503f5437b619b3422ee42bb09d29dc' 
  AND (
    token = 'GDHY8maC8X6cFuSbHw29syWghsNF5omFTCdL+srMwnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040