UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R10PTNX+mWWuwYnLDvhKyJGnIvvXwGBzvGA0wqhsRZQ='
WHERE
key_id = 'a11b3f9ba1cf182d9a7bb4ec4cd198911758c8488e46533aaa502dde4a911bec'
AND (
token = 'R10PTNX+mWWuwYnLDvhKyJGnIvvXwGBzvGA0wqhsRZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)