UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dl/7d/Ndo3huJHkJfORaBFii+z2JAVhEBK55U0hq15k='
WHERE
key_id = 'a963bb0507149841ebdc953ebd6bec0ce4ed8b71b16758ef05250a321efe470f'
AND (
token = 'Dl/7d/Ndo3huJHkJfORaBFii+z2JAVhEBK55U0hq15k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)