UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3VaSFGToe6B6KBy2KfF3tmPvekJDrBdOcFxkEcqVYXU='
WHERE
key_id = 'd29ea5f33cb1db70da9edc6e3627a387a3a4e0941a2ddc23427246d467ac502b'
AND (
token = '3VaSFGToe6B6KBy2KfF3tmPvekJDrBdOcFxkEcqVYXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)