UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VWQS4XKn8viW3A2znSGajUEDIiS6W1q9p9SjUa/uRMM=' 
WHERE 
  key_id = 'ebe8f2bcd7e7b63c47b39b7badbb5cc5241f2bf10ac5f4ff50a2aee6ccc438de' 
  AND (
    token = 'VWQS4XKn8viW3A2znSGajUEDIiS6W1q9p9SjUa/uRMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028