UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xwtnQCLNQ2GZ9EwRgmSpGY2svT3jEE1vqIefwsceNco='
WHERE
key_id = '2e567342ddacbd95cfb82b86028d4c2b38f3499e73dc883d8c46a82d22af00c3'
AND (
token = 'xwtnQCLNQ2GZ9EwRgmSpGY2svT3jEE1vqIefwsceNco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)