UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qaV2xf78eQ2/+jJgthtLvOC8+dCKR2ODaxLUmPf5URU=' 
WHERE 
  key_id = 'dbcaab8de1a195471ad4aa789665f80897eb70f999a3251836c11bb7d0d0b408' 
  AND (
    token = 'qaV2xf78eQ2/+jJgthtLvOC8+dCKR2ODaxLUmPf5URU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019