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