UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KD9Ye+IEy/mtajSUMD8hXDWcssVN9VDaBqPIXO4vab8=' 
WHERE 
  key_id = '1b263fed1e4c7ba4ca4730f3bfabc77d9f145eb28cd632ac69aeb1e59119449c' 
  AND (
    token = 'KD9Ye+IEy/mtajSUMD8hXDWcssVN9VDaBqPIXO4vab8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017