UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HVOsYLYEGCSSb3UG4bpJCmmj/psYl2NCafRAcE8BKxs='
WHERE
key_id = '11271894764629f410c34fb5b630e16f64c4585f89b866c4c69c8a24a67e8ede'
AND (
token = 'HVOsYLYEGCSSb3UG4bpJCmmj/psYl2NCafRAcE8BKxs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)