UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZU0rOZv2qXCRRYCAp7RpbnNK2zwt/cJPJvu9Vh9bZQo='
WHERE
key_id = '030bc9e06cf060028bf238bce2b39251ecbc387e436d9456cc7729e768157cb9'
AND (
token = 'ZU0rOZv2qXCRRYCAp7RpbnNK2zwt/cJPJvu9Vh9bZQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)