UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CKhyM+lgU7R8FFxN0f0VqDl45mi+7mYHefXjrspZhNA='
WHERE
key_id = 'bf9d66e08ea87694fe424e2e0ba0b2e36ace38114f99573ae39e8d9e8b66f6d3'
AND (
token = 'CKhyM+lgU7R8FFxN0f0VqDl45mi+7mYHefXjrspZhNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)