UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yIIBACn9z4UZ5qzyz1DVFrUoVzi9uS+7MzimnqCB9/k='
WHERE
key_id = '1a15ec1fce96b3270eae7ce8d7c4d846cae61bd4f9e7e89c74317d934e9c0fad'
AND (
token = 'yIIBACn9z4UZ5qzyz1DVFrUoVzi9uS+7MzimnqCB9/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)