UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6B0r4nfuVGdsVWlBzu5rEJKScmhVSUVmW33ro1nUw6M='
WHERE
key_id = '368621528423a8a6d7c950bab926b6bef53919186d9aa6a184056781bc03e0d5'
AND (
token = '6B0r4nfuVGdsVWlBzu5rEJKScmhVSUVmW33ro1nUw6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)