UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6l6n2D9wq9AcQ5utn5omxOBp6ehYqi9YBipESbf3qYo='
WHERE
key_id = 'c62c256e40bd6bf3496e852b71294253bace976008abc5acb8acca85dd885097'
AND (
token = '6l6n2D9wq9AcQ5utn5omxOBp6ehYqi9YBipESbf3qYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)