UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vmhBFLNGvhTHP5nKSTgYYD2aCwQAeNEYAn+VE+9g+tc='
WHERE
key_id = '695d0fdd1db6349ffb119ee8e9aff5f51b24183820cd49727fcb9fe655bd0382'
AND (
token = 'vmhBFLNGvhTHP5nKSTgYYD2aCwQAeNEYAn+VE+9g+tc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)