UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YBIHCalfgE6t+qzbK7PUH8pzDG6waOkmVqY9tPaPifE=' 
WHERE 
  key_id = 'c682d9259e4144eea6db546b9dd86f7354e43f058ef0cde9547b9715c75ccefc' 
  AND (
    token = 'YBIHCalfgE6t+qzbK7PUH8pzDG6waOkmVqY9tPaPifE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032