UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UHllr4sAtSQkNfGDaR6P68Ksnbsqcxc7HnJlV6/8nMg='
WHERE
key_id = 'e10a9d040e94bbf8b7514f64d7dd345ead2c0e40733d7de5c8a22f647c039802'
AND (
token = 'UHllr4sAtSQkNfGDaR6P68Ksnbsqcxc7HnJlV6/8nMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)