UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lui/9EZ0b13D+y3LgiYoIQZD6mpGGXobX/bbXbWVhHs='
WHERE
key_id = '0bfe0c116b86620e0f15adaa91eb989083bd8c1fdf31bc76893bf32dcc50a3d7'
AND (
token = 'Lui/9EZ0b13D+y3LgiYoIQZD6mpGGXobX/bbXbWVhHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)