UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2fA5F6h9t7uq0uLKp/VjUH3cPvRUxYuMpbCdNgpgeL4='
WHERE
key_id = 'bf8f8efdd317eb367de13b92644eb922f885ff2e2b66ebb61e32385b0e98bafe'
AND (
token = '2fA5F6h9t7uq0uLKp/VjUH3cPvRUxYuMpbCdNgpgeL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)