UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Xh14pKoMeh16jcr07ROXyg1N5lEe3nyN0CQ0tdLwPc='
WHERE
key_id = '2620b505a4346192bb2e215468daa9905d6d4a487d1b6cf47189c05bd9ace5a7'
AND (
token = '5Xh14pKoMeh16jcr07ROXyg1N5lEe3nyN0CQ0tdLwPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)