UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '18tWAyoLyrWmg1fFOdwjRUw1rEoJdxfArSp39yLmeNo='
WHERE
key_id = '567690ed10ce9dedf73a25998ed7e57490dba012667b8820053a48b03ce9d8ad'
AND (
token = '18tWAyoLyrWmg1fFOdwjRUw1rEoJdxfArSp39yLmeNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)