UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'px2s+0HqhPmkGHVBJWpuhA/NHFy9sPao0dYuA0vszHc='
WHERE
key_id = 'b0246cfe244557ca229b3b9accd5c4324a225940cc60530c83c5efe521013142'
AND (
token = 'px2s+0HqhPmkGHVBJWpuhA/NHFy9sPao0dYuA0vszHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)