UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ryAK+v7Ej07b/umwm8x3Mc9lIBg5RIRXBfs4qYJ2JGU=' 
WHERE 
  key_id = '06bacde73b9d822487981fbcac55c7d0757797789b6c0e447f1dd931dc93948c' 
  AND (
    token = 'ryAK+v7Ej07b/umwm8x3Mc9lIBg5RIRXBfs4qYJ2JGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023