UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RvpVLJmyQB4nz5Y/0/P0d9k4E8xmA8EkwRoEZiJDVgQ=' 
WHERE 
  key_id = 'dac3480bdebdebd1369ce5d8bc4963b718b3b60a810c60973e122e7300f4882c' 
  AND (
    token = 'RvpVLJmyQB4nz5Y/0/P0d9k4E8xmA8EkwRoEZiJDVgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019