UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gz5dwfuJWJEnve27Lbd0SwBAvO/5zDpSozbxAbexpeg='
WHERE
key_id = 'c6b8fc1f286db6fd8140a482afe1229a4425ecc27ea003ce14ab6da9c4dadd69'
AND (
token = 'Gz5dwfuJWJEnve27Lbd0SwBAvO/5zDpSozbxAbexpeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)