UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v1XBkDpvUZl1Ghv+NKbmAy0DxSHwkzZIK+JxQXlm98s='
WHERE
key_id = 'be8f935336873293ea0302afcfe7250a58f280f7c59cb0c91edeeaced7f1d762'
AND (
token = 'v1XBkDpvUZl1Ghv+NKbmAy0DxSHwkzZIK+JxQXlm98s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)