UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8oFw38jKS7hen/W5Wk6lWfS0tc+iL4EEhoSP2QuvOqc='
WHERE
key_id = 'dcacdbe77546f6ac857eb53d66f3ee9cbf380e945c9dfdc0a861cf96f986228e'
AND (
token = '8oFw38jKS7hen/W5Wk6lWfS0tc+iL4EEhoSP2QuvOqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)