UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uXjmwmkscI10nvXygqdDVT/NDAPDtww0XC5pUjCBlYo=' 
WHERE 
  key_id = '935cefa895bcfc24c896316f9944a795c69f741c798ffd7fa7249bc5a30104b0' 
  AND (
    token = 'uXjmwmkscI10nvXygqdDVT/NDAPDtww0XC5pUjCBlYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041