UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L6sroy+18XJTOnJeu225O0VyLgDfn1BF9uIXtp9jjtE='
WHERE
key_id = 'ff8cc9ad64f58f8b00b1875315d576a6fc0cd67981fa8f16a58641700a120a46'
AND (
token = 'L6sroy+18XJTOnJeu225O0VyLgDfn1BF9uIXtp9jjtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)