UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1soXNGZSFoliK6jvFJW5VeiruZZVLjSrO8PBvZ7GbEM='
WHERE
key_id = 'aee159a022b45a58af26fdc4a4af71ecf806dc175c94354ce1f257a744cd0620'
AND (
token = '1soXNGZSFoliK6jvFJW5VeiruZZVLjSrO8PBvZ7GbEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)