UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yvywqzkit5ZoatjG/J673Jxxtu4QgRuoIHT0uiZx3Rk='
WHERE
key_id = '8a111ceb69e513d605199fd1bad3af5fc398443cbd82308cea366628db1aa2c8'
AND (
token = 'yvywqzkit5ZoatjG/J673Jxxtu4QgRuoIHT0uiZx3Rk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)