UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '53R4fUE/kyxTZDx0ZxMozzF5OAp51TY+cUrf10si9Og='
WHERE
key_id = '3e78aa6beaec44734ed3f20e7a70840b69b952e9e4852ff422f3e1053552b6b4'
AND (
token = '53R4fUE/kyxTZDx0ZxMozzF5OAp51TY+cUrf10si9Og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)