UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wVqwm6W4We85RiVxMkB8Ae87QKdaGIfsfX/+MpJ8jgI=' 
WHERE 
  key_id = 'b046b1fb4acc7afb2cce1a22918cef14af65b9e5e268169ada8ef7e848b9d8e3' 
  AND (
    token = 'wVqwm6W4We85RiVxMkB8Ae87QKdaGIfsfX/+MpJ8jgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035