UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iWKA0ATuhjbfvP2vXYjBHVMtfnANPoqc6GgRQWJHXnY='
WHERE
key_id = '7113670973b2b64679f582476e749d9c2f8c50e2e0f565fdcf5f37f337675636'
AND (
token = 'iWKA0ATuhjbfvP2vXYjBHVMtfnANPoqc6GgRQWJHXnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)