UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BQwBwN4uxnZ4IVXEXUx4IqkqLeMXcVfdFYEFuQmYsbI=' 
WHERE 
  key_id = '22fc6ee7679d9984fcc797341175872dbbc544a3ba13c731a94347bf23b80992' 
  AND (
    token = 'BQwBwN4uxnZ4IVXEXUx4IqkqLeMXcVfdFYEFuQmYsbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025