UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oahMV1dY1k0fqBokFRJ/wLpJLa7EdFwsUBpj7bTLqbM=' 
WHERE 
  key_id = '91b2f3413eba653960bc5c3a046e9f5a526560e5fbfa043a6818f8b6a6f10504' 
  AND (
    token = 'oahMV1dY1k0fqBokFRJ/wLpJLa7EdFwsUBpj7bTLqbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037