UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Lr2KYEZzf6ZyflFMU4vwzEmEnI7JNdLhYDdUpNv85c=' 
WHERE 
  key_id = '8a7cead885950acafc083ecb14c7bac81e066b47b588e24a59202f5e9e31b775' 
  AND (
    token = '6Lr2KYEZzf6ZyflFMU4vwzEmEnI7JNdLhYDdUpNv85c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034