UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QMYv6KWPFwIQD6DCf5cDIMc0LhZ/f5dp7DRt0dIWt2s=' 
WHERE 
  key_id = 'a59f7a2ebbea2953c0973cf462f965a01a251881c09095520bb4f14034f11352' 
  AND (
    token = 'QMYv6KWPFwIQD6DCf5cDIMc0LhZ/f5dp7DRt0dIWt2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017