UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'czrbSE+2JAUjtUWv2MkG83sVvCWFlkciXC9DAbtkOfA='
WHERE
key_id = '21f71b52c62db41ed87378daabd1be80cc820722afd18a9ce67250b75e884358'
AND (
token = 'czrbSE+2JAUjtUWv2MkG83sVvCWFlkciXC9DAbtkOfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)