UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GllIugHVqUd6hAHAfForDOeFbzUT51eBDQmgOc4McBw=' 
WHERE 
  key_id = '0dec09af0185f07885c21495620a0e0226fab6392c2d7befcdee5e813bd4fba0' 
  AND (
    token = 'GllIugHVqUd6hAHAfForDOeFbzUT51eBDQmgOc4McBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030