UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+/Rips0BmV4gvOlg5z5pCQXZfajyhlu7ffrLDoM3yOg='
WHERE
key_id = '29406470e3b6011e5dc9ccd4a4fc3c47442ffd2fa26f7d61538c249b9d1ffa25'
AND (
token = '+/Rips0BmV4gvOlg5z5pCQXZfajyhlu7ffrLDoM3yOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)